/**
 * @description 微信相关接口
 */

const router = require('koa-router')()
const { SuccessModel, ErrorModel } = require('../model/ResModel')
const {
    getWxOpenId
} = require('../controller/wx')


router.prefix('/api/wx')

//获取用户openId
router.post('/code', async (ctx,next)=>{
    const {code:js_code} = ctx.request.body
    const result = await getWxOpenId(js_code)
    ctx.body = result
})

module.exports = router